home *** CD-ROM | disk | FTP | other *** search
/ Amiga Collections: Memphis Amiga Group / MAG Disk (1990-09)(Memphis Amiga Group).zip / MAG Disk (1990-09)(Memphis Amiga Group).adf / sMOVIE / source / sMOVIEmessage.c < prev    next >
C/C++ Source or Header  |  1989-12-29  |  931b  |  57 lines

  1. /*    Send sMOVIE messages to user either in Workbench or CLI.
  2.     Martin J. Round.    15-Oct-1989
  3.     Many thanks to Ali T. Ozer for his IFF2PCS program which this
  4.     routine is based on.
  5. */
  6.  
  7. #include "sMOVIE.h"
  8.  
  9. extern int runningfromcli;
  10.  
  11. extern BPTR _Backstdout;
  12.  
  13. void print (char *);
  14.  
  15. void message (m)
  16. UBYTE *m;
  17. {
  18.     static struct IntuiText negtxt  =
  19.         {0,1,COMPLEMENT,4,4,NULL,(UBYTE *)" O.K.",NULL};
  20.     static struct IntuiText bodytxt =
  21.         {0,1,COMPLEMENT,10,6,NULL,NULL,NULL};
  22.  
  23.     if (m) {
  24.         if (runningfromcli) {
  25.             print (m);
  26.             print ("\n");
  27.             }
  28.         else {
  29.             bodytxt.IText = m;
  30.             WBenchToFront ();
  31.             if (AutoRequest (NULL, &bodytxt, NULL, &negtxt, 0L, 0L,
  32.                 (long)(Max(Min(strlen(m)*10+50,625),200)),
  33.                 54L) == TRUE) return;
  34.             }
  35.         }
  36. }
  37.  
  38. void print(s)
  39. char *s;
  40. {
  41.     if (_Backstdout)
  42.         Write(_Backstdout, s, strlen(s));
  43. }
  44.  
  45. int Min (a, b)
  46. int a, b;
  47. {
  48.   return ((a > b) ? b : a);
  49. }
  50.  
  51.  
  52. int Max (a, b)
  53. int a, b;
  54. {
  55.   return ((a > b) ? a : b);
  56. }
  57.